package com.yhl.admin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yhl
 * @create 2021-06-27 20:48
 */
@Controller
public class DruidTestController {

    @Autowired
    JdbcTemplate jdbcTemplate;

    @ResponseBody
    @GetMapping("/sql")
    public long DruidController(){

        Long amount = jdbcTemplate.queryForObject("select count(*) from blog;", long.class);

        return amount;
    }
}
